C Program to print Pyramid Pattern using star for n number of lines.[Pattern 14]| Using C language| C Program series 35|
👨💻C Program to print Pyramid Pattern (▲) using star for n number of lines.[Pattern:14]
Code :
For n number of LINES:
/*
C Program to print Pyramid Pattern using star for n number of lines.[Pattern 14]
For Example:n=5
*
* *
* * *
* * * *
* * * * *
*/
#include <stdio.h>
main()
{
int i,j,n,temp;
printf("C Program to print Pyramid Pattern using star for n number of lines.[Pattern 14]\n\n");
printf("Enter the number:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
temp=n;
for(j=temp-i;j>0;j--)
{
printf(" ");
}
for(j=1;j<=i;j++)
{
printf("* ");
}
printf("\n");
}
}
The output of Code:
![C Program to print Pyramid Pattern using star for n number of lines.[Pattern 14]](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbK6zJn1z-Qrlxx5B7lIHGwSBwUN-6_D3TnxoA8CqvuTymnPqBLRTWm8O281NZwIF-DFTXxKSIkhSj70eQrcnTJz6MHU7YLdEwUeKO17GTr2RBgGSCfxKRaiqfufINz_VSN8CJzJlY0TUHa4yCOCoerCZK6htib9c-mkkc7IoSnRzYOgdB5Mx3gNE/w640-h168/Screenshot%202022-11-03%20163329.jpg)
![C Program to print Pyramid Pattern using star for n number of lines.[Pattern 14]](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxkvPYcG5eXo-cjSWTKaG4FBgRG8cYLpFmmQmMmAlpP7hfeWogzGBMAvYqKTTF0qqkIsj_FGxII1Zp5bLIC6XfWy99hQk8pPDJQU2PZP078AVSDubvfLjJ7dTfZ2atpndWrNqsja_7ddze4foh9V8fiVm9cv_9lp1mCX1PHDptmc7Bzx8c6o6aXFo/w640-h232/Screenshot%202022-11-03%20163404.jpg)
![C Program to print Pyramid Pattern using star for n number of lines.[Pattern 14]](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWtuFZnmdoXQzfeJA31TfTEWWr4_6H1mLpDdrJOKhOqX4Tden-EyPV4bYAd-SWW7jx7CGo_7dQopGRPj-BaaZ87ExR07pz_3msv8OOrUfdY2zB1xFlKYMA8jGwM-8nNjq7-zRMToOOciFGFAxRyIu5WmAn5ozKGM_dLQXKhM_9xw6l6USVYdzRAuQ/w640-h418/Screenshot%202022-11-03%20163423.jpg)
Comments
Post a Comment